{extend name="Master/base" /} {block name="title"}后台主页{/block} {block name="main"}

<section class="content-header">
    <h1>
        项目回款管理
    </h1>
    <ol class="breadcrumb">

    </ol>
</section>

<section class="content">
    <div class="row">
        <div class="box box-success">
            <div class="box-header with-border">
                <h3 class="box-title">项目回款信息</h3>
            </div>
            <form role="form" class="validator_form" action="{:url('/Index/Project/Returned/edit')}" id="editProjectReturnedForm" method="post">
                <input type="hidden" name="project_price" value="{$projet_info.price?=$projet_info.price}">
                <input type="hidden" name="id" value="{$info.id?=$info.id}">

                <div class="box-body">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>项目名称</label>
                            <label class="form-control">{$info.project["title"]}</label>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>项目合同金额</label>
                            <label class="form-control" id="project_price">{$info.project["price"]}</label>

                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>计划回款金额(万) </label>
                            <input type="text" name="plan_price" class="form-control" id="plan_price" value="{$info.plan_price?=$info.plan_price}" required placeholder="计划回款比例">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>计划回款比例(%)</label>
                            <input type="text" name="plan_ratio" class="form-control" id="plan_ratio" value="{$info.plan_ratio?=$info.plan_ratio}" required placeholder="计划回款金额">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>实际回款金额(万)</label>
                            <input type="text" name="real_price" class="form-control" id="real_price" value="{$info.real_price?=$info.real_price}" required placeholder="实际回款金额">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>实际回款比例(%)</label>
                            <input type="text" name="real_ratio" class="form-control" id="real_ratio" value="{$info.real_ratio?=$info.real_ratio}" required placeholder="实际回款比例">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>计划完成时间</label>
                            <input type="text" name="plan_time" class="form-control datepicker" value="{$info.plan_time?=$info.plan_time}" id="plan_time" required placeholder="计划完成时间">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>实际完成时间</label>
                            <input type="text" name="real_time" class="form-control datepicker" value="{$info.real_time?=$info.real_time}" id="real_time" required placeholder="实际完成时间">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>状态</label>
                            <select name="status" class="form-control" id="status" required>
                                    <option value="">请选择</option>
                                    {volist  name="code_status" id="vo"}
                                    <option value="{$vo.m_value}"  {$vo['m_value']==$info['status']?'selected="selected"':''}>{$vo.m_name}</option>
                                    {/volist}
                            </select>

                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>回款策略</label>
                            <input type="text" name="strategy" class="form-control" id="strategy" required placeholder="回款策略" value="{$info.strategy?=$info.strategy}">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>风险</label>
                            <input type="text" name="risk" class="form-control" id="risk" required placeholder="风险" value="{$info.risk?=$info.risk}">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>协助用户</label>
                            <select name="assist_users[]" class="form-control select2" id="assist_users" required multiple>
                                 
                                    {volist  name="users" id="vo"}
                                    <option value="{$vo.id}" {:in_array($vo.id,$user_ids)?'selected="selected"':''}>{$vo.nickname}</option>
                                    {/volist}
                            </select>
                        </div>
                    </div>
                </div>
                <div class="box-footer">
                    <button type="submit" class="btn btn-primary">确认</button>
                </div>

        </div>

        </form>
        <!-- /.box-body -->
    </div>
    </div>
</section>
{/block}
<!--script -->
{block name="script"}
<script>
    $(function() {
        $("#plan_price").keyup(function() {
            var total_price = $("#project_price").text();
            total_price = parseFloat(total_price);
            var plan_price = $(this).val();
            var plan_ratio = 0;
            plan_price = parseFloat(plan_price);
            if (plan_price) {
                plan_ratio = (plan_price / total_price) * 100;
            }
            $("#plan_ratio").val(plan_ratio.toFixed(4));

        });


        $("#real_price").keyup(function() {
            var total_price = $("#project_price").text();
            total_price = parseFloat(total_price);
            var real_price = $(this).val();
            var real_ratio = 0;
            real_price = parseFloat(real_price);
            if (real_price) {
                real_ratio = (real_price / total_price) * 100;
            }
            $("#real_ratio").val(real_ratio.toFixed(4));

        });
    });
</script>

{/block}